/**
 * 
 * © Bahadir Zeren 2011
 * bzeren@gmail.com
 * No warranties, express or implied, are made for this program.
 * 
 */

package org.baatar.opt.genetic;

import java.util.EventListener;

/**
 * Listener class which is triggered when a genetic iteration is completed.
 * 
 */
public interface GeneticIterationListener<T> extends EventListener {

    /**
     * Metod which is called after each progress.
     * 
     * @param go genetic optimizer which is in progress.
     * @param iteration iteration number.
     * @param info String representation of the best individual.
     */
    public void onProgress(GeneticOptimizer<T> go, int iteration, String info);

    /**
     * Metod which is called after each genetic iteration.
     * 
     * @param iteration current iteration step.
     * @param numOfIterationsPassedWOProgress Number of iterations passed without progress.
     * @param maxNumOfIterations maximum number of iterations algorithm can reach.
     */
    public void onIterate(int iteration,
                            int numOfIterationsPassedWOProgress,
                            int maxNumOfIterations);
}
